﻿using System;

namespace SharePoint.Contrib
{
    /// <summary>
    /// Represents a generic eventargs class.
    /// </summary>
    /// <typeparam name="T">The typeof(T) to send in the event</typeparam>
    public class EventArgs<T> : EventArgs
    {
        private T value;

        /// <summary>
        /// Initializes a new instance of the <see cref="EventArgs&lt;T&gt;"/> class.
        /// </summary>
        public EventArgs(T value)
        {
            this.value = value;
        }

        /// <summary>
        /// Gets the value of the event
        /// </summary>
        public T Value
        {
            get { return this.value; }
        }

        /// <summary>
        /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
        /// </summary>
        public override string ToString()
        {
            return this.value.ToString();
        }
    }
}
